calculating intensity